import { Module } from "vuex";
import { RootProps } from "../index";

interface venuesprops{
    name: string
    address: string
    email:string
    tel:number
    state:string
}
export interface venuesArrayProps {
    tableData: venuesprops[]
}
const venuesState: Module<venuesArrayProps, RootProps> = {
    actions: {
        setDataList({commit}, data){
            commit("setDataList", data)
        }
    },
    mutations: {
        setUserList(state, data){
            state.tableData = data;
        },
        addvenues(state,data){
            state.tableData.push(data)
        },
    },
state:{
    tableData:[{
        name: 'Tom',
        tel:18881477422,
        address: 'No. 189, Grove St, Los Angeles',
        email:'33445562@qq.com',
        state:'正常'

      },
      {
        name: '张杰',
        tel:18881477422,
        address: 'No. 189, Grove St, Los Angeles',
        email:'33445562@qq.com',
        state:'正常'
      },
      {
        name: 'T',
        tel:18881477422,
        address: 'No. 189, Grove St, Los Angeles',
        email:'33445562@qq.com',
        state:'正常'
      },
      {
        name: '李易',
        tel:18881477422,
        address: 'No. 189, Grove St, Los Angeles',
        email:'33445562@qq.com',
        state:'正常'
      },]
},
getters: {
    allDateList(state){
        return state.tableData
    }
}
}
export default venuesState